package com.dsteiner.widgets.server.dao;

import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.dsteiner.widgets.client.domain.BaseObject;
import com.dsteiner.widgets.client.domain.Distinct;
import com.dsteiner.widgets.client.domain.ModelObject;
import com.dsteiner.widgets.client.rpc.SearchRequest;
import com.dsteiner.widgets.client.rpc.SearchResult;

public interface BaseDataDao{

	<T extends ModelObject> void deleteObject(String id, Class<T> objectClass);

	<T extends ModelObject>void deleteObject(T modelObject);
	
	<T extends ModelObject> void deleteObjects(Class<T> objectClass, List<Parameter> parametersList); 

	<T extends ModelObject> T getObjectById(String id, Class<T> objectClass);
	 
	<T extends ModelObject> List<String> getObjectIds(Class<T> clazz);
	
	<T extends ModelObject> List<T> getObjects(Class<T> classObj);

	<T extends ModelObject> List<T> getObjects(Class<T> classObj, List<Parameter> parametersList);
	
	<T extends ModelObject> List<T> getObjects(Class<T> classObj, List<Parameter> parametersList, String ordering);

	<T extends ModelObject> List<T> getObjects(Class<T> classObj, List<Parameter> parametersList, String ordering, Integer limit);
	
	<T extends ModelObject> List<T> getTopModelObjects(Class<T> modelObjectClass, String ordering);
	 
	<T extends ModelObject> boolean isExistant(Class<T> classObj, List<Parameter> parametersList);

	<T extends ModelObject> T save(T object);
	
	<T extends ModelObject> SearchResult<T> search(SearchRequest searchRequest);

	<T extends ModelObject> Map<String, Change> updateObject(T modelObject);

	<T extends ModelObject> Collection<T> save(Collection<T> objects);

}
